﻿
Namespace httpServer2Tests
    Public Module amutest
        Private WithEvents server As httpServer2 = Nothing
        Private ReadOnly fakeOutput As String = createGUID(rnd(50, 1000))

        Public Sub start()
            server = New httpServer2()
            server.addport(80)
            server.start(32)
        End Sub

        Private Sub server_receive(ByVal context As httpContext) Handles server.receive
            assert(Not context Is Nothing, "context is nothing.")
            context.setcontentType(network.http.contentType.texthtmlUtf8)
            context.writer().WriteLine(fakeOutput)
        End Sub

        Private Sub server_reject(ByVal context As httpContext) Handles server.reject
            assert(False, "do not enabled ddoslite, so should not have reject requests.")
        End Sub
    End Module
End Namespace
